package com.lwp.test.spring;

import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ApplicationContextEvent;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;

/**
 * 监听类实例化后,只监听指定 ApplicationContextEvent 事件
 * <p>
 *     ContextRefreshedEvent , 扫描的类已经实例化完成
 * </p>
 */
@Component
public class ApplicatiListener2 implements ApplicationListener<ContextRefreshedEvent> {


    /**
     * ok
     * @param event
     */
    @Override
    public void onApplicationEvent(ContextRefreshedEvent event) {
        System.out.println("********* ApplicatiListener2  7777777777  " + event.getClass().getName());
    }
}
